<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\UserResource;
use App\Models\User;
use Illuminate\Http\Request;
use Jiannei\Response\Laravel\Support\Facades\Response;

class UserController extends Controller
{
    //根据token获取用户详情
    public function info(){
        $user = auth('api')->user();
        $users = User::query()->find($user->id);
        return Response::success(new UserResource($users),'操作成功');
    }
}
